package Cantella::DJabberd::Model::Admin::RosterItem::Action::Create;

use Reaction::Class;

#use Reaction::Types::Core qw( NonEmptySimpleStr );
use aliased 'Reaction::InterfaceModel::Action::DBIC::ResultSet::Create' => 'DBIC_Create';

class Create is DBIC_Create, which {

#   has name => (is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1);
#   has contact_jid => (is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1);
  has roster_groups => (
                       is  => 'rw',
                       isa => 'ArrayRef',
                       valid_values => sub {
                         shift->target_model->result_source
                           ->related_source('roster_group_items')
                             ->relates_source('roster_group')->resultset;
                       }
                      );

#   has owner =>
#     (
#      is           => 'rw',
#      isa          => 'Cantella::DJabberd::Store::Result::UserJid',
#      lazy_fail    => 1,
#      valid_values => sub {
#        shift->target_model->result_source->related_source('owner')
#          ->resultset;
#      },
#     );

#   #make this default to mutual or whatever
#   has subscription => (is  => 'rw', isa => 'Int', lazy_fail => 1);

};

1;
